/**
 * Clase que representa la estructura de la tabla en un objeto Java. Cada
 * atributo de la tabla es creado como variables y su formato como anotaciones
 *
 * @version 1.0, 25/04/12
 * @author emojica
 */
package supervision.autocomplete;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

@ManagedBean(name = "supervision_autocompleteBeans")
@ViewScoped
public class Beans {

    public request.general.Beans requestBeans = new request.general.Beans();
    public request.location.Beans requestSedeBeans = new request.location.Beans();
    public university.general.Beans universityBeans = new university.general.Beans();
    public university.faculty.Beans facultyBeans = new university.faculty.Beans();
    public university.location.Beans universityLocationBeans = new university.location.Beans();

    public Beans() {
    }

    public Beans(Integer id_solicitud, Integer id_curriculum_sede, String nombreUniversidad, String nombreFacultad, String nombreSede, String nombreCarrera) {
        this.requestBeans.setId(id_solicitud);
        this.requestSedeBeans.setId(id_curriculum_sede);
        this.universityBeans.setNombre(nombreUniversidad);
        this.facultyBeans.setNombre(nombreFacultad);
        this.universityLocationBeans.setNombre(nombreSede);
        this.requestBeans.setCarrera(nombreCarrera);
    }

    /**
     * Método que permite inicializar todas las variables
     */
    public void clearBeans() {

        this.getUniversityBeans().clearBeans();
        this.getFacultyBeans().clearBeans();
    }

    private String strScape(String data) {
        data = data.trim();
        data = data.replace("'", "''");
        data = data.replace("\\", "\\\\");
        return data;
    }

    /**
     * @return the requestBeans
     */
    public request.general.Beans getRequestBeans() {
        return requestBeans;
    }

    /**
     * @param requestBeans the requestBeans to set
     */
    public void setRequestBeans(request.general.Beans requestBeans) {
        this.requestBeans = requestBeans;
    }

    /**
     * @return the requestSedeBeans
     */
    public request.location.Beans getRequestSedeBeans() {
        return requestSedeBeans;
    }

    /**
     * @param requestSedeBeans the requestSedeBeans to set
     */
    public void setRequestSedeBeans(request.location.Beans requestSedeBeans) {
        this.requestSedeBeans = requestSedeBeans;
    }

    /**
     * @return the universityBeans
     */
    public university.general.Beans getUniversityBeans() {
        return universityBeans;
    }

    /**
     * @param universityBeans the universityBeans to set
     */
    public void setUniversityBeans(university.general.Beans universityBeans) {
        this.universityBeans = universityBeans;
    }

    /**
     * @return the facultyBeans
     */
    public university.faculty.Beans getFacultyBeans() {
        return facultyBeans;
    }

    /**
     * @param facultyBeans the facultyBeans to set
     */
    public void setFacultyBeans(university.faculty.Beans facultyBeans) {
        this.facultyBeans = facultyBeans;
    }

    /**
     * @return the universityLocationBeans
     */
    public university.location.Beans getUniversityLocationBeans() {
        return universityLocationBeans;
    }

    /**
     * @param universityLocationBeans the universityLocationBeans to set
     */
    public void setUniversityLocationBeans(university.location.Beans universityLocationBeans) {
        this.universityLocationBeans = universityLocationBeans;
    }
}
